<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>amline</title>
</head>
<style>
  body{
  	background-color: #FFFFFF;
  	font-family: Arial;
  	font-size: 12px;
  }
</style>
<body>
<b><font color="red">Attention! Because of security restrictions in most cases this example will work only if you upload files to your web server.</font></b><br><br>
<!-- saved from url=(0013)about:internet -->

<script type="text/javascript" src="../amline/swfobject.js"></script>

<script type="text/javascript">
      // chart control functions ///////////////////////////////////
      // show graph
      function showGraph(){
         var index = document.getElementById("graphshow").value;
         flashMovie.showGraph(index);
      }
      // hide graph
      function hideGraph(){
         var index = document.getElementById("graphhide").value;         
         flashMovie.hideGraph(index);
      }
      // select graph
      function selectGraph(){
         var index = document.getElementById("graphselect").value;
         flashMovie.selectGraph(index);
      }            
      // deselect graph
      function deselectGraph(){
         var index = document.getElementById("graphdeselect").value;
         flashMovie.deselectGraph(index);
      }                
      
      // set data
      function setData() {
         var txt = document.getElementById("data").value;
         flashMovie.setData(txt);
      }
      // append data
      function appendData() {
         var txt = document.getElementById("data").value;
         flashMovie.appendData(txt, 0);             // appendData(data, remove_count) this function appends data to the end of current data and can remove x values from the beginning
      }      
      // reload data
      function reloadData() {
         flashMovie.reloadData("",true);          // reloadData(new_data_file_name, show_all)
      }
      // reload settings
      function reloadSettings() {
         flashMovie.reloadSettings("",true);      // reloadSettings(new_settings_file_name, show_all)
      }
      // reload all
      function reloadAll() {
         flashMovie.reloadAll("","",true);        // reloadAll(new_data_file_name, new_settings_file_name, show_all)
      }
      // set param
      function setParam() {
         var param = document.getElementById("param").value;
         var value = document.getElementById("value").value;
         flashMovie.setParam(param, value);
      }
      // get param
      function getParam() {
         var param = document.getElementById("getparam").value;            
         flashMovie.getParam(param);
      } 
      // get data
      function getData() {
         flashMovie.getData();
      }
      // export image
      function exportImage() {
         flashMovie.exportImage('../amline/export.php'); // it is not required to pass filename here if you set it in settings file) 
      }
      // print chart. Use this print function if you don't have rotated by 90 degrees values, also if you don't have custom backgrounds
      function print(){
         flashMovie.print();
      }
      // print chart as bitmap. Use this print function if you have rotated by 90 degrees text
      function printAsBitmap(){
         flashMovie.printAsBitmap();
      }   
      // set zoom
      function setZoom(from, to){
         var from = document.getElementById("from").value;
         var to = document.getElementById("to").value;  
         flashMovie.setZoom(from, to); 
      }  
      // show all (zoom to default)
      function showAll(){
         flashMovie.showAll(); 
      }
      // this function is called from right-click menu
      function selectInterval(interval){
          flashMovie.setZoom(2006 - interval, 2006);
      } 
      
      
      
      // functions called from flash /////////////////////////////////////////
      // this function is called then chart is finished
      function amChartInited(chart_id){
          flashMovie = document.getElementById("amline");
          document.getElementById("chartfinished").value = "chart " + chart_id + " is finished";           
      }      
      // return param     
      function amReturnParam(chart_id, param){
          document.getElementById("returnedparam").value = unescape(param);           
      }      
      // return data 
      function amReturnData(chart_id, param){
          document.getElementById("data").value = unescape(param);          
      }      
      // get zoom
      function amGetZoom(chart_id, from, to){
          document.getElementById("from").value = from;
          document.getElementById("to").value = to;
      } 
      // this function is called then user selects graph by clicking on it           
      function amGraphSelect(chart_id, index, title){
          document.getElementById("graphselect").value = index;
      }
      // this function is called then user deselects graph by clicking on it           
      function amGraphDeselect(chart_id, index, title){
          document.getElementById("graphdeselect").value = index;
      }   
      // this function is called then user hides graph by clicking on the legend key           
      function amGraphHide(chart_id, index, title){
          document.getElementById("graphhide").value = index;
      }
      // this function is called then user shows hidden graph by clicking the legend key           
      function amGraphShow(chart_id, index, title){
          document.getElementById("graphshow").value = index;
      } 
      // this function is called when indicator position changes           
      function amRolledOverSeries(series){
          document.getElementById("series_hover").value = series;
      }
      // this function is called when user clicks on plot area             
      function amClickedOnSeries(series){
          document.getElementById("series_clicked").value = series;
      }
      // this function is called when user clicks on bullet (only if this bullet has url attribute or clickable_bullets is set to true in graph configuration)            
      function amClickedOnBullet(graph_index, value, series, url, description){
          document.getElementById("bullet_clicked").value = value;
      }          
      // this function is called when user rolls over the bullet (only if this bullet has url attribute or clickable_bullets is set to true in graph configuration)             
      function amRolledOverBullet(graph_index, value, series, url, description){
          document.getElementById("bullet_hover").value = value;
      }  
      // error 
      function amError(chart_id, message){
          alert(message);
      }                    
   // ]]>
</script>


<!-- amline script-->
	<div id="flashcontent">
		<strong>You need to upgrade your Flash Player</strong>
	</div>

	<script type="text/javascript">
		// <![CDATA[		
		var so = new SWFObject("../amline/amline.swf", "amline", "520", "400", "8", "#FFFFFF");
		so.addVariable("path", "../amline/");
    so.addVariable("chart_id", "chart1");		
		so.addVariable("settings_file", escape("amline/js/amline_settings.xml"));
		so.addVariable("data_file", escape("amline/js/amline_data.xml"));
		so.addVariable("preloader_color", "#999999");
		so.write("flashcontent");
		// ]]>
	</script>
<!-- end of amline script -->

		<form action="" id="myform">
      <input type="text" id="chartfinished">		
      <input type="button" value="reload Data" onclick="reloadData();" />
	    <input type="button" value="reload Settings" onclick="reloadSettings();" />
      <input type="button" value="reload All" onclick="reloadAll();" />
    	<hr noshade size="1">
      <input type="button" value="export image" onclick="exportImage();" />            	    
      <input type="button" value="print" onclick="print();" />
      <input type="button" value="print as bitmap" onclick="printAsBitmap();" />
      <hr noshade size="1">	
      Indicator is on:<input type="text" id="series_hover">
      Clicked on series:<input type="text" id="series_clicked">
      <hr noshade size="1">	
      Rolled over bullet:<input type="text" id="bullet_hover">
      Clicked on bullet:<input type="text" id="bullet_clicked">      
    	<hr noshade size="1">	
      <textarea id="data" rows="6" cols="62"></textarea><br>
   	   <input type="button" value="Get data" onclick="getData();" />
       <input type="button" value="Set Data" onclick="setData();" />
       <input type="button" value="Append Data" onclick="appendData();" />
   		<hr noshade size="1">	 
  	  Param: <input type="text" id="param" value="graphs.graph[0].hidden"/> Value: <input type="text" id="value" value="true"/>
      <input type="button" value="set param" onclick="setParam();" />
   		<hr noshade size="1">   
   	  Param: <input type="text" id="getparam" value="axes.x.width">   		
   		Value: <input type="text" id="returnedparam" />
   		<input type="button" value="get param" onclick="getParam();" />
      <hr noshade size="1">       
      Zoom from: <input type="text" id="from"/> to: <input type="text" id="to"/><input type="button" value="set zoom" onclick="setZoom();" /><input type="button" value="show all" onclick="showAll();" />
      <hr noshade size="1">
      Select:<input type="text" id="graphselect" value="0"/><input type="button" value="select" onclick="selectGraph();" />
      Deselect:<input type="text" id="graphdeselect" value="0"/><input type="button" value="deselect" onclick="deselectGraph();" />
      <hr noshade size="1">
      Show:<input type="text" id="graphshow" value="1"/><input type="button" value="show" onclick="showGraph();" />
      Hide:<input type="text" id="graphhide" value="1"/><input type="button" value="hide" onclick="hideGraph();" />
		</form>
Right-click on the chart - you will see custom menu items. These items are configurable - you can assign custom JavaScript functions to them.
</body>
</html>
